'use strict';

/* 主页 */

var React = require('react-native');
var Banner = require('./HomeView/Banner');
var Functions = require('./HomeView/Functions');
var ProductList = require('./components/ProductList');

var {
	AndroidPullToRefreshView
} = require('react-native-yankai-refresh');

var {
	StyleSheet,
	Text,
	View,
	ScrollView,
	ToastAndroid
} = React;


module.exports = React.createClass({

	propTypes: {
		navigator: React.PropTypes.object.isRequired
	},

	render: function() {
		return (
			<AndroidPullToRefreshView
				style={styles.container}
				colors="#FF0000,red,green"
				size="large">
				<ScrollView>
					<View style={[styles.top]}>
						<Banner navigator={this.props.navigator}/>
						<Functions navigator={this.props.navigator}/>
					</View>
					<View>
						<ProductList/>
					</View>
				</ScrollView>
			</AndroidPullToRefreshView>
		)
	}

})

var styles = StyleSheet.create({
	container: {
		flex: 1,
	},
	top: {
		backgroundColor: '#FFF'
	},
});